package com.kmxd.ams.client.arrange.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 目录树管理
 *
 * @author nickbi
 * @since 2022-08-04
 */
@Data
@Schema(description = "目录树管理对象")
public class CatalogVO implements Serializable {

  private static final long serialVersionUID = 1L;

  @Schema(description = "主键ID")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long id;

  @Schema(description = "全宗ID")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long fondsId;

  @Schema(description = "档案类型id 档案类型id")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long archTypeId;

  @Schema(description = "档案表名 档案表名，用来区分项目、案卷、文件、盒")
  private String tableId;

  @Schema(description = "节点类型 1条件节点，2分组节点")
  private Integer type;

  @Schema(description = "管理库类型：1收集库，2档案库")
  private Integer manageType;

  @Schema(description = "自定义节点: 0否，1是")
  private Boolean customize;

  @Schema(description = "节点名称 节点名称")
  private String name;

  @Schema(description = "父节点id 父节点id")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long pid;

  @Schema(description = "有无子节点 0无子节点，1有子节点，默认为0")
  private Boolean hasChild;

  @Schema(description = "数据节点sql 数据节点sql,只存where之后的条件")
  private String dataCondition;

  @Schema(description = "排序 同级排序")
  private Integer sort;

  @Schema(description = "创建人")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long createBy;

  @Schema(description = "创建时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createTime;
}
